<?php PhanQuyenDiemDanh(); ?>
<div style="width:100%">
	<div class="Title" style="width:100%; color:#333; font-size:16px">Danh mục các lớp học</div>
	<div class="Table">
		<table width="50%" style="border-spacing:0; border:1px solid #DDD">
			<tr style="background-color: #DDD">
				<th style="" width="10%">STT</th>
				<th>Mã lớp</th>
			</tr>
			<?php
				$MaGiaoVien = $_SESSION['GV']['MaGiaoVien'];
				
				include_once '../classes/lophoc_bs.php';
				include_once '../classes/hopdong_bs.php';
				include_once '../classes/giaovien_bs.php';
				
				$HopDong = new hopdong_bs();
				$HopDong->SetMaGiaoVien($MaGiaoVien);
				$DHopDong = $HopDong->LayDanhSach();
				
				if($HopDong != null)
				{
					for($i = 0; $i < count($DHopDong); $i++)
					{
						$LopHoc = new lophoc_bs();
						$LopHoc->SetmaLopHoc($DHopDong[$i]['MaLopHoc']);
						$DLopHoc = $LopHoc->LayDanhSach();
						$MLH = $DLopHoc[0]['MaLopHoc'];
						$PIN = $DLopHoc[0]['PIN'];
						$link = "index.php?act=diemdanh&mlh=$MLH&pin=$PIN";
						echo '<tr>';
							echo '<td align="center"><b>' . ($i + 1) . '</b></td>';
							echo '<td><a href="' . $link . '">' . $DLopHoc[0]['MaLopHoc'] . '</a></td>';
						echo '</tr>';
					}
				}
			?>
		</table>
	</div>
</div>